/**
 * 
 */
package STUDENTS.TRANTHAIHA.DEMO;

import java.util.Scanner;

/**
 * @author Administrator
 *
 */
public class testptb2 {
	public static void main(String[] args) {
	int a,b,c;
	System.out.println("hay nhap gia tri cua a");
	Scanner scan = new Scanner(System.in);
	a=scan.nextInt();
	
	System.out.println("hay nhap gia tri cua b");
	b=scan.nextInt();
	
	System.out.println("hay nhap gia tri cua c");
	c=scan.nextInt();

	if (a == 0){
    	System.out.println("phuong trinh co 1 nghiem : " + ( c * (-1) / b) );
    }
	else{
		if ((b*b - 4*a*c) < 0){
			System.out.println("phuong trinh vo nghiem ");
		}
		else{
			System.out.println("phg trinh co 2 nghiem" );
			System.out.println("nghiem 1 : "+ ((b*b - Math.sqrt(b*b - 4*a*c)/2*a ) ));
			System.out.println("nghiem 2 : "+ ((b*b +  Math.sqrt(b*b - 4*a*c)/2*a ) ));
		}
	}
			
	}
	
}
